package com.zjitc.controller;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2016091400508584";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDDRhbrGwi+UlPET2qgr4WGsMcY/fmR7UM5nwsnv6XHHf5HPMXSZRVX0tfyIY2FgaoIyY0XyDUsgZkiSdYhSUN2k+SMK7O/Vyu50qE6pyTbiGJEglRF534t2M2KSGbBaQaHM/cDtqhax4Fp7Zqc96EHQBmPC1o+P+G2ybdRtyPNIsG9LTEwlKsJmhWz5Ca3Wq+rc7j/7Ww/vJtuUMG6ScxM5aRrEiXDPRGgTCUVCCX1ezl7X/+gTPHdtoKb1Xf8M6X4QZ8w9SBQfNOuttB+WwK0n0ssagkENR4mxUq3oSW0U8twP3+VJ3zEKWuMZC1/MEJ9uaWsjbVGfxglFrrcuJ/9AgMBAAECggEAAY1oFzxiyGiNI+1hsp9Sl2yGWKuENWXGeAnMo+dBISEa6WQRSoflMIqLjvA3WM1cFa/MgFjmG1F4by5ZFnCnqaSpV3fteOLvhQ2onHfBskEWTuceVmPtu92SXLwQnQ8Br0d5ej0Uf4xAeiAab48EZ7NZwKpdcEs/tx1JaMvk6/eMMgzQuOOcksiNEmFtnMMm0iKw3Yv+hUuvtzrjtynl4j0hbLkGB+gCVNd7Aoub+5FnuK8TX/PHy8pheFULKtrwXIh+FrF7vzYRB5sXdJmxaqEDLc4whGAhRhCCyiWCKlgE3NHr9bdiV04jqv+NBGPyb+FCQPdr4GFnn8hTQLCDXQKBgQD3T0oes7p8uAcB1Zwb762o8gZuPHXGZ9JcCIMk0EAszKMY589VpLI1Eq/X8x7OOy1l8JlBr4eS4C9GYpXi0zRUyv/AbKjWxICBlY0Ei1yQMNs7bUXKL01yWtzNeAHo3/3oITI9BJvK1hkIz25P9r4J8J78H3q3fHYTlRhqrYD5HwKBgQDKIrQDZpOwVe+GY6+5HsNXqHgaAHcfjxdyilukv/hm7VXfm5ve5QiImnp4XBRSuh0KCiOUpv2ClEotn7DXize3o79af7et71UjlG+KQgfGYSjioXqRGlxL4p3fsH0uKUAqorCAKa6NuMLDeA/maAipplAnuHlFoCGVbCYYpzmXYwKBgEZduhIoQzxvRBcihytvs7KpQmklLMGKEtF63o2f71KP2ywf8N9GYCo3qe7AzxgQwGcL4R9OaT3CKdFWBZ2nSHGD3OcMQ7Hv8Txtp9UOLgUc0ZQEEGJpuRh7f+26Ypi2+tCMeXXhFM7Owgq+sn1wEDxVyXalIk6IzDPgLTVVLqgzAoGAUxmnRgqixwjdWzOaZ5HFH0GMdqwgTSInspg9CuM9PRtvhWlU0HL6aiaQGPFKDaSkEZ+Pdyqb6FYMlOsk6cg7VM0F+y+slN5i8yiwHnf8+EqzY1Cdsg/TSANXgkHthM/CqISP6XC5aVw+/dtbNg8pGI3eQCYv/TbS97opg1Mkcx8CgYBQNNzXKxzElCGJnybkUxotN9zvGPcOVfgLpcj0ateyjitY9OghTNI2jRCf82Y+8jWV1jM0fIzCiZiyv9UU2mpyjASKws33MdrbF7mK3iiHDueWpXvZSKR4qsYiTocTnC16NhnxhIvqKB8Zk0u1aZzANBuFK8CnZUmFB5fIicKkEw==";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzpcmwG7cT3/XwEJGJQ7iZR4ECRTK4mACs7vDcrnDkk4FKs+N1kkKDUTuhna4whjKJsOiNZv13+BAqcbAVkETiPgsMSB4/V4e4KfWTOFH/Wm2jCTpDxNRYKcjwOpkl3gyGpTecg0A1OxFdFzSp1CcSiLRFtTFC5Kt+egTw+4BW9rsWGu1t/FG8YrZ6BI5YP/UFjRKIUdMGYhPXeMcqtotm3p7rYdAgx+x6K94l6vBN5eEWJmfUYGflMvVhs15Tdytq8nOQu8gRKCKnVveI95kBsRnQv98g+2ZNLouv7+LgTJlKR4HjXOPHW2tquJqnlpOTKV1AOX1Qr1xnA67Qa1xNQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://localhost:8080/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost:8080/creatOrderList";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

